<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const arr = ['name', 'age', 'hhh', 'hhh', 'age', 'hhh', 'hhh', 'hhh']
        let obj = {}
        arr.map((item) => {
            if (obj[item]) {
                obj[item]++
            } else {
                obj[item] = 1
            }
        })
        console.log(obj)


        const a = [1, 2, 3, 5]
        const b = [1, 3, 5, 6]

       console.log( a.filter(item => !b.includes(item))) 

       const arr2 = [1, 2, 3, 2, 9]
       console.log([...new Set(arr2)])

    </script>
</body>

</html>